import {request} from "@/api";
import {SysDept, SysDeptDiagram} from "@/api/dept/types.ts";

const apiPrefix = '/varian-system/dept'
export const deptApi = {
    add: (data: SysDept) => request.post<SysDept>(`${apiPrefix}`, {data}),
    tree: () => request.get<SysDept[]>(`${apiPrefix}/tree`),
    detail: (id: string) => request.get<SysDept>(`${apiPrefix}/${id}`),
    modify: (data: SysDept) => request.put(`${apiPrefix}/${data.id}`, {data}),
    diagram: () => request.get<SysDeptDiagram>(`${apiPrefix}/diagram`),
    fixValue: () => request.get(`${apiPrefix}/fix-value`),
}
